This project provides a skeleton which allows you to execute linear, old-style BASIC code (as opposed to the event-driven programming normally done in REALbasic). It can be used as a demonstration of threading, or to ease the porting of old BASIC programs.
Usage:
1. Open up the "console.rb" project (if you have several BASIC programs you want to keep around, you might make a copy of "console.rb" for each one -- it doesn't matter what you call the project file).
2. Paste or type the program code into the "Main()" method of the "ProgramCode" class.
3. If your code has DATA statements, put the data into the large textbox in the "ProgramData" window. Data consists of strings or numbers separated by commas or line breaks.
4. Run the program. That's it!
You can skip right to step 4 the first time; by default, you get a simple program which asks you to enter your name and a number, then prints your name that number of times.
Compatibility:
This code has been tested with REALbasic 2.1b7. It should work under Windows as well.
Special functions for Console Basic:
Input <prompt>, <stringvar> -- prompts for input from the user
Print <var> -- prints a string
PrintNoCR <var> -- prints a string, without a carriage return
Clear -- clears the string
ReadStr <stringvar> -- reads string data from the ProgramData window
ReadNum <numbervar> -- reads numeric data from the ProgramData window
Questions? Comments?
This project was written by Joe Strout (joe@realsoftware.com). Feel free to contact me with any questions or comments about this code.